﻿@using Treca.PushMessage.Entity;
@using Treca.Util;
@using EFCore.Sharding; 
@using Treca.Business.Base_SysManage;
@inherits DependencyViewPage 
@using System.Data;
@using Microsoft.AspNetCore.Http;
@using Newtonsoft.Json;
@using Treca.Base_SysManage.Entity;
@{
    Layout = "~/Views/Shared/_Layout_NewMainForm.cshtml";

    var rownum = this.ViewData["rownum"];
    var guid = this.ViewData["guid"];
    var key = this.ViewData["key"];
    var value = this.ViewData["value"];
    if (rownum.IsNullOrEmpty())
    {
        rownum = -1;
    }
    BaseDataHelper dataHelper = (BaseDataHelper)this.ViewData["listHelper"];
}
<div class="fx-wrapper">
      <form class="form-inline" id="searchForm"   style="width: 800px"> 
         <div class="form-group">             
           <!--   <div class="col-sm-2 input-icon-group"  style="width: 60 % "> 
                @TranslateService.GetTranslate("","System_AddFile","添加文件")
               <div id="WorkerContractImg" style="width:120px;height:104px;overflow:inherit" ></div>
            </div>
            <button type = "button" class="btn btn-info btn-sm" onclick="speech()" );" >
                <i class="glyphicon glyphicon-export" ></i>
                @TranslateService.GetTranslate("","System_SpeechInput","语音输入")
            </button>
            <input type = "file1" id="file1" name ="myfile1" style="display: none" />
      
            <button type = "button" class="btn btn-success btn-sm" onclick="OCRForm()" );" >
                <i class="glyphicon glyphicon-export" ></i>
                @TranslateService.GetTranslate("","System_FormRecognition","表单识别")
            </button>-->

        </div>
    </form>
</div>
<div style="padding:15px;padding-right:45px;">
    <form id="form" class="form-horizontal" role="form">
        
                          <div class="form-group form-group-sm">
                        <label class="col-sm-2 control-label">@TranslateService.GetTranslate("","PushMessage_ms_messagepointconfig_pointcode","推送点代码")</label>
                        <div class="col-sm-5">@{
                                        base_selectresource_data dataselectpointcode = dataHelper.GetDataUrlAll("PushMessage", "ms_messagepointconfig", "pointcode");
                                        if(!dataselectpointcode.sr.IsNullOrEmpty()&&!dataselectpointcode.sr.Id.IsNullOrEmpty()){
                                            if( dataselectpointcode.bs.selecttype=="1")
                                            {
                                                <select id='pointcode' name="pointcode" value="" class="form-control column selectpicker" data-live-search="true"  >
                                                    @foreach (DataRow rows in dataselectpointcode.data.Rows)
                                                    {
                                                             <option value="@rows[0]" >@rows[1]</option>
                                                    }
                                                </select>
                                            
                                            }
                                            if( dataselectpointcode.bs.selecttype=="3")
                                            {
                                                <select id='pointcode' name="pointcode" value="" class="form-control column selectpicker" data-live-search="true" multiple >
                                                    @foreach (DataRow rows in dataselectpointcode.data.Rows)
                                                    {
                                                             <option value="@rows[0]" >@rows[1]</option>
                                                    }
                                                </select>
                                            }
                                             if( dataselectpointcode.bs.selecttype=="2")
                                             {
                                                 string typename = @dataselectpointcode.sr.tablename.Split('.')[@dataselectpointcode.sr.tablename.Split('.').Length - 1];
                                                 string areaname = @dataselectpointcode.sr.tablename.Split('.')[@dataselectpointcode.sr.tablename.Split('.').Length - 3];
                                                 <input id='pointcode__Name' name='pointcode__Name' value='' onclick='openFormSelect("/@areaname/@typename","@dataselectpointcode.sr.filedcode,@dataselectpointcode.sr.filedvalue",this); ' type='text' class='form-control column'  readonly='readonly'/>
                                                 <input id='pointcode' name='pointcode' value=''  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                              }
                                             if( dataselectpointcode.bs.selecttype=="4")
                                             {
                                                 <div id='pointcodeImg' style='width:100%; height:200px; overflow: auto'></div>
                                                 <input id='pointcode__Name' name='pointcode__Name' value='' type='text' style='display:none'  class='form-control column'  readonly='readonly'/>
                                                 <input id='pointcode' name='pointcode' value=''  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                                  @Html.Raw("<script>\n");
                                                  @Html.Raw("$(function(){\n");
                                                  @Html.Raw("$('#pointcode__Img').html5Uploader({\n");
                                                  @Html.Raw("asyncUpload: true,\n");
                                                  @Html.Raw("uploadUrl: '/Base_SysManage/Common/UploadFile',\n");
                                                  @Html.Raw($"uploadLimit: {dataselectpointcode.getPropValue("filenum")},  //上传数量限制，0为不限\n");
                                                  @Html.Raw($"sizeLimit:{dataselectpointcode.getPropValue("filesize")},    //大小限制，M\n");
                                                  @Html.Raw($"type: '{dataselectpointcode.getPropValue("filetype")}' //file即可上传文件也可上传图片\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("$('#pointcode__Name').on(' input propertychange',function(){\n");
                                                  @Html.Raw("var urls = $(this).val().split(',');\n");
                                                  @Html.Raw("var ids = $('#pointcode').val().split(',');\n");
                                                  @Html.Raw("$.each(urls, function(index, url){\n");
                                                  @Html.Raw("if(url!='')\n");
                                                  @Html.Raw("$('#pointcode__Img').html5Uploader('insertItemNew',{src:url,id:ids[index]});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("</script>\n");
                                              }
                                        }
                                        else {
                                        <input id='pointcode' name="pointcode"  maxlength="100" value="" type="text" class="form-control column" >}}
                                </div>
                            </div>
                          <div class="form-group form-group-sm">
                        <label class="col-sm-2 control-label">@TranslateService.GetTranslate("","PushMessage_ms_messagepointconfig_pointname","推送点名称")</label>
                        <div class="col-sm-5">@{
                                        base_selectresource_data dataselectpointname = dataHelper.GetDataUrlAll("PushMessage", "ms_messagepointconfig", "pointname");
                                        if(!dataselectpointname.sr.IsNullOrEmpty()&&!dataselectpointname.sr.Id.IsNullOrEmpty()){
                                            if( dataselectpointname.bs.selecttype=="1")
                                            {
                                                <select id='pointname' name="pointname" value="" class="form-control column selectpicker" data-live-search="true"  >
                                                    @foreach (DataRow rows in dataselectpointname.data.Rows)
                                                    {
                                                             <option value="@rows[0]" >@rows[1]</option>
                                                    }
                                                </select>
                                            
                                            }
                                            if( dataselectpointname.bs.selecttype=="3")
                                            {
                                                <select id='pointname' name="pointname" value="" class="form-control column selectpicker" data-live-search="true" multiple >
                                                    @foreach (DataRow rows in dataselectpointname.data.Rows)
                                                    {
                                                             <option value="@rows[0]" >@rows[1]</option>
                                                    }
                                                </select>
                                            }
                                             if( dataselectpointname.bs.selecttype=="2")
                                             {
                                                 string typename = @dataselectpointname.sr.tablename.Split('.')[@dataselectpointname.sr.tablename.Split('.').Length - 1];
                                                 string areaname = @dataselectpointname.sr.tablename.Split('.')[@dataselectpointname.sr.tablename.Split('.').Length - 3];
                                                 <input id='pointname__Name' name='pointname__Name' value='' onclick='openFormSelect("/@areaname/@typename","@dataselectpointname.sr.filedcode,@dataselectpointname.sr.filedvalue",this); ' type='text' class='form-control column'  readonly='readonly'/>
                                                 <input id='pointname' name='pointname' value=''  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                              }
                                             if( dataselectpointname.bs.selecttype=="4")
                                             {
                                                 <div id='pointnameImg' style='width:100%; height:200px; overflow: auto'></div>
                                                 <input id='pointname__Name' name='pointname__Name' value='' type='text' style='display:none'  class='form-control column'  readonly='readonly'/>
                                                 <input id='pointname' name='pointname' value=''  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                                  @Html.Raw("<script>\n");
                                                  @Html.Raw("$(function(){\n");
                                                  @Html.Raw("$('#pointname__Img').html5Uploader({\n");
                                                  @Html.Raw("asyncUpload: true,\n");
                                                  @Html.Raw("uploadUrl: '/Base_SysManage/Common/UploadFile',\n");
                                                  @Html.Raw($"uploadLimit: {dataselectpointname.getPropValue("filenum")},  //上传数量限制，0为不限\n");
                                                  @Html.Raw($"sizeLimit:{dataselectpointname.getPropValue("filesize")},    //大小限制，M\n");
                                                  @Html.Raw($"type: '{dataselectpointname.getPropValue("filetype")}' //file即可上传文件也可上传图片\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("$('#pointname__Name').on(' input propertychange',function(){\n");
                                                  @Html.Raw("var urls = $(this).val().split(',');\n");
                                                  @Html.Raw("var ids = $('#pointname').val().split(',');\n");
                                                  @Html.Raw("$.each(urls, function(index, url){\n");
                                                  @Html.Raw("if(url!='')\n");
                                                  @Html.Raw("$('#pointname__Img').html5Uploader('insertItemNew',{src:url,id:ids[index]});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("</script>\n");
                                              }
                                        }
                                        else {
                                        <input id='pointname' name="pointname"  maxlength="100" value="" type="text" class="form-control column" >}}
                                </div>
                            </div>
                          <div class="form-group form-group-sm">
                        <label class="col-sm-2 control-label">@TranslateService.GetTranslate("","PushMessage_ms_messagepointconfig_ispush","是否推送")</label>
                        <div class="col-sm-5">@{
                                        base_selectresource_data dataselectispush = dataHelper.GetDataUrlAll("PushMessage", "ms_messagepointconfig", "ispush");
                                        if(!dataselectispush.sr.IsNullOrEmpty()&&!dataselectispush.sr.Id.IsNullOrEmpty()){
                                            if( dataselectispush.bs.selecttype=="1")
                                            {
                                                <select id='ispush' name="ispush" value="" class="form-control column selectpicker" data-live-search="true"  >
                                                    @foreach (DataRow rows in dataselectispush.data.Rows)
                                                    {
                                                             <option value="@rows[0]" >@rows[1]</option>
                                                    }
                                                </select>
                                            
                                            }
                                            if( dataselectispush.bs.selecttype=="3")
                                            {
                                                <select id='ispush' name="ispush" value="" class="form-control column selectpicker" data-live-search="true" multiple >
                                                    @foreach (DataRow rows in dataselectispush.data.Rows)
                                                    {
                                                             <option value="@rows[0]" >@rows[1]</option>
                                                    }
                                                </select>
                                            }
                                             if( dataselectispush.bs.selecttype=="2")
                                             {
                                                 string typename = @dataselectispush.sr.tablename.Split('.')[@dataselectispush.sr.tablename.Split('.').Length - 1];
                                                 string areaname = @dataselectispush.sr.tablename.Split('.')[@dataselectispush.sr.tablename.Split('.').Length - 3];
                                                 <input id='ispush__Name' name='ispush__Name' value='' onclick='openFormSelect("/@areaname/@typename","@dataselectispush.sr.filedcode,@dataselectispush.sr.filedvalue",this); ' type='text' class='form-control column'  readonly='readonly'/>
                                                 <input id='ispush' name='ispush' value=''  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                              }
                                             if( dataselectispush.bs.selecttype=="4")
                                             {
                                                 <div id='ispushImg' style='width:100%; height:200px; overflow: auto'></div>
                                                 <input id='ispush__Name' name='ispush__Name' value='' type='text' style='display:none'  class='form-control column'  readonly='readonly'/>
                                                 <input id='ispush' name='ispush' value=''  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                                  @Html.Raw("<script>\n");
                                                  @Html.Raw("$(function(){\n");
                                                  @Html.Raw("$('#ispush__Img').html5Uploader({\n");
                                                  @Html.Raw("asyncUpload: true,\n");
                                                  @Html.Raw("uploadUrl: '/Base_SysManage/Common/UploadFile',\n");
                                                  @Html.Raw($"uploadLimit: {dataselectispush.getPropValue("filenum")},  //上传数量限制，0为不限\n");
                                                  @Html.Raw($"sizeLimit:{dataselectispush.getPropValue("filesize")},    //大小限制，M\n");
                                                  @Html.Raw($"type: '{dataselectispush.getPropValue("filetype")}' //file即可上传文件也可上传图片\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("$('#ispush__Name').on(' input propertychange',function(){\n");
                                                  @Html.Raw("var urls = $(this).val().split(',');\n");
                                                  @Html.Raw("var ids = $('#ispush').val().split(',');\n");
                                                  @Html.Raw("$.each(urls, function(index, url){\n");
                                                  @Html.Raw("if(url!='')\n");
                                                  @Html.Raw("$('#ispush__Img').html5Uploader('insertItemNew',{src:url,id:ids[index]});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("</script>\n");
                                              }
                                        }
                                        else {
                                        <input id='ispush' name="ispush"  maxlength="50" value="" type="text" class="form-control column" >}}
                                </div>
                            </div>
                          <div class="form-group form-group-sm">
                        <label class="col-sm-2 control-label">@TranslateService.GetTranslate("","PushMessage_ms_messagepointconfig_appid","AppId")</label>
                        <div class="col-sm-5">@{
                                        base_selectresource_data dataselectappid = dataHelper.GetDataUrlAll("PushMessage", "ms_messagepointconfig", "appid");
                                        if(!dataselectappid.sr.IsNullOrEmpty()&&!dataselectappid.sr.Id.IsNullOrEmpty()){
                                            if( dataselectappid.bs.selecttype=="1")
                                            {
                                                <select id='appid' name="appid" value="" class="form-control column selectpicker" data-live-search="true"  >
                                                    @foreach (DataRow rows in dataselectappid.data.Rows)
                                                    {
                                                             <option value="@rows[0]" >@rows[1]</option>
                                                    }
                                                </select>
                                            
                                            }
                                            if( dataselectappid.bs.selecttype=="3")
                                            {
                                                <select id='appid' name="appid" value="" class="form-control column selectpicker" data-live-search="true" multiple >
                                                    @foreach (DataRow rows in dataselectappid.data.Rows)
                                                    {
                                                             <option value="@rows[0]" >@rows[1]</option>
                                                    }
                                                </select>
                                            }
                                             if( dataselectappid.bs.selecttype=="2")
                                             {
                                                 string typename = @dataselectappid.sr.tablename.Split('.')[@dataselectappid.sr.tablename.Split('.').Length - 1];
                                                 string areaname = @dataselectappid.sr.tablename.Split('.')[@dataselectappid.sr.tablename.Split('.').Length - 3];
                                                 <input id='appid__Name' name='appid__Name' value='' onclick='openFormSelect("/@areaname/@typename","@dataselectappid.sr.filedcode,@dataselectappid.sr.filedvalue",this); ' type='text' class='form-control column'  readonly='readonly'/>
                                                 <input id='appid' name='appid' value=''  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                              }
                                             if( dataselectappid.bs.selecttype=="4")
                                             {
                                                 <div id='appidImg' style='width:100%; height:200px; overflow: auto'></div>
                                                 <input id='appid__Name' name='appid__Name' value='' type='text' style='display:none'  class='form-control column'  readonly='readonly'/>
                                                 <input id='appid' name='appid' value=''  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                                  @Html.Raw("<script>\n");
                                                  @Html.Raw("$(function(){\n");
                                                  @Html.Raw("$('#appid__Img').html5Uploader({\n");
                                                  @Html.Raw("asyncUpload: true,\n");
                                                  @Html.Raw("uploadUrl: '/Base_SysManage/Common/UploadFile',\n");
                                                  @Html.Raw($"uploadLimit: {dataselectappid.getPropValue("filenum")},  //上传数量限制，0为不限\n");
                                                  @Html.Raw($"sizeLimit:{dataselectappid.getPropValue("filesize")},    //大小限制，M\n");
                                                  @Html.Raw($"type: '{dataselectappid.getPropValue("filetype")}' //file即可上传文件也可上传图片\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("$('#appid__Name').on(' input propertychange',function(){\n");
                                                  @Html.Raw("var urls = $(this).val().split(',');\n");
                                                  @Html.Raw("var ids = $('#appid').val().split(',');\n");
                                                  @Html.Raw("$.each(urls, function(index, url){\n");
                                                  @Html.Raw("if(url!='')\n");
                                                  @Html.Raw("$('#appid__Img').html5Uploader('insertItemNew',{src:url,id:ids[index]});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("</script>\n");
                                              }
                                        }
                                        else {
                                        <input id='appid' name="appid"  maxlength="100" value="" type="text" class="form-control column" >}}
                                </div>
                            </div>
                          <div class="form-group form-group-sm">
                        <label class="col-sm-2 control-label">@TranslateService.GetTranslate("","PushMessage_ms_messagepointconfig_wxappid","跳转小程序Id")</label>
                        <div class="col-sm-5">@{
                                        base_selectresource_data dataselectwxappid = dataHelper.GetDataUrlAll("PushMessage", "ms_messagepointconfig", "wxappid");
                                        if(!dataselectwxappid.sr.IsNullOrEmpty()&&!dataselectwxappid.sr.Id.IsNullOrEmpty()){
                                            if( dataselectwxappid.bs.selecttype=="1")
                                            {
                                                <select id='wxappid' name="wxappid" value="" class="form-control column selectpicker" data-live-search="true"  >
                                                    @foreach (DataRow rows in dataselectwxappid.data.Rows)
                                                    {
                                                             <option value="@rows[0]" >@rows[1]</option>
                                                    }
                                                </select>
                                            
                                            }
                                            if( dataselectwxappid.bs.selecttype=="3")
                                            {
                                                <select id='wxappid' name="wxappid" value="" class="form-control column selectpicker" data-live-search="true" multiple >
                                                    @foreach (DataRow rows in dataselectwxappid.data.Rows)
                                                    {
                                                             <option value="@rows[0]" >@rows[1]</option>
                                                    }
                                                </select>
                                            }
                                             if( dataselectwxappid.bs.selecttype=="2")
                                             {
                                                 string typename = @dataselectwxappid.sr.tablename.Split('.')[@dataselectwxappid.sr.tablename.Split('.').Length - 1];
                                                 string areaname = @dataselectwxappid.sr.tablename.Split('.')[@dataselectwxappid.sr.tablename.Split('.').Length - 3];
                                                 <input id='wxappid__Name' name='wxappid__Name' value='' onclick='openFormSelect("/@areaname/@typename","@dataselectwxappid.sr.filedcode,@dataselectwxappid.sr.filedvalue",this); ' type='text' class='form-control column'  readonly='readonly'/>
                                                 <input id='wxappid' name='wxappid' value=''  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                              }
                                             if( dataselectwxappid.bs.selecttype=="4")
                                             {
                                                 <div id='wxappidImg' style='width:100%; height:200px; overflow: auto'></div>
                                                 <input id='wxappid__Name' name='wxappid__Name' value='' type='text' style='display:none'  class='form-control column'  readonly='readonly'/>
                                                 <input id='wxappid' name='wxappid' value=''  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                                  @Html.Raw("<script>\n");
                                                  @Html.Raw("$(function(){\n");
                                                  @Html.Raw("$('#wxappid__Img').html5Uploader({\n");
                                                  @Html.Raw("asyncUpload: true,\n");
                                                  @Html.Raw("uploadUrl: '/Base_SysManage/Common/UploadFile',\n");
                                                  @Html.Raw($"uploadLimit: {dataselectwxappid.getPropValue("filenum")},  //上传数量限制，0为不限\n");
                                                  @Html.Raw($"sizeLimit:{dataselectwxappid.getPropValue("filesize")},    //大小限制，M\n");
                                                  @Html.Raw($"type: '{dataselectwxappid.getPropValue("filetype")}' //file即可上传文件也可上传图片\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("$('#wxappid__Name').on(' input propertychange',function(){\n");
                                                  @Html.Raw("var urls = $(this).val().split(',');\n");
                                                  @Html.Raw("var ids = $('#wxappid').val().split(',');\n");
                                                  @Html.Raw("$.each(urls, function(index, url){\n");
                                                  @Html.Raw("if(url!='')\n");
                                                  @Html.Raw("$('#wxappid__Img').html5Uploader('insertItemNew',{src:url,id:ids[index]});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("</script>\n");
                                              }
                                        }
                                        else {
                                        <input id='wxappid' name="wxappid"  maxlength="100" value="" type="text" class="form-control column" >}}
                                </div>
                            </div>
                          <div class="form-group form-group-sm">
                        <label class="col-sm-2 control-label">@TranslateService.GetTranslate("","PushMessage_ms_messagepointconfig_pagepath","小程序跳转页面")</label>
                        <div class="col-sm-5">@{
                                        base_selectresource_data dataselectpagepath = dataHelper.GetDataUrlAll("PushMessage", "ms_messagepointconfig", "pagepath");
                                        if(!dataselectpagepath.sr.IsNullOrEmpty()&&!dataselectpagepath.sr.Id.IsNullOrEmpty()){
                                            if( dataselectpagepath.bs.selecttype=="1")
                                            {
                                                <select id='pagepath' name="pagepath" value="" class="form-control column selectpicker" data-live-search="true"  >
                                                    @foreach (DataRow rows in dataselectpagepath.data.Rows)
                                                    {
                                                             <option value="@rows[0]" >@rows[1]</option>
                                                    }
                                                </select>
                                            
                                            }
                                            if( dataselectpagepath.bs.selecttype=="3")
                                            {
                                                <select id='pagepath' name="pagepath" value="" class="form-control column selectpicker" data-live-search="true" multiple >
                                                    @foreach (DataRow rows in dataselectpagepath.data.Rows)
                                                    {
                                                             <option value="@rows[0]" >@rows[1]</option>
                                                    }
                                                </select>
                                            }
                                             if( dataselectpagepath.bs.selecttype=="2")
                                             {
                                                 string typename = @dataselectpagepath.sr.tablename.Split('.')[@dataselectpagepath.sr.tablename.Split('.').Length - 1];
                                                 string areaname = @dataselectpagepath.sr.tablename.Split('.')[@dataselectpagepath.sr.tablename.Split('.').Length - 3];
                                                 <input id='pagepath__Name' name='pagepath__Name' value='' onclick='openFormSelect("/@areaname/@typename","@dataselectpagepath.sr.filedcode,@dataselectpagepath.sr.filedvalue",this); ' type='text' class='form-control column'  readonly='readonly'/>
                                                 <input id='pagepath' name='pagepath' value=''  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                              }
                                             if( dataselectpagepath.bs.selecttype=="4")
                                             {
                                                 <div id='pagepathImg' style='width:100%; height:200px; overflow: auto'></div>
                                                 <input id='pagepath__Name' name='pagepath__Name' value='' type='text' style='display:none'  class='form-control column'  readonly='readonly'/>
                                                 <input id='pagepath' name='pagepath' value=''  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                                  @Html.Raw("<script>\n");
                                                  @Html.Raw("$(function(){\n");
                                                  @Html.Raw("$('#pagepath__Img').html5Uploader({\n");
                                                  @Html.Raw("asyncUpload: true,\n");
                                                  @Html.Raw("uploadUrl: '/Base_SysManage/Common/UploadFile',\n");
                                                  @Html.Raw($"uploadLimit: {dataselectpagepath.getPropValue("filenum")},  //上传数量限制，0为不限\n");
                                                  @Html.Raw($"sizeLimit:{dataselectpagepath.getPropValue("filesize")},    //大小限制，M\n");
                                                  @Html.Raw($"type: '{dataselectpagepath.getPropValue("filetype")}' //file即可上传文件也可上传图片\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("$('#pagepath__Name').on(' input propertychange',function(){\n");
                                                  @Html.Raw("var urls = $(this).val().split(',');\n");
                                                  @Html.Raw("var ids = $('#pagepath').val().split(',');\n");
                                                  @Html.Raw("$.each(urls, function(index, url){\n");
                                                  @Html.Raw("if(url!='')\n");
                                                  @Html.Raw("$('#pagepath__Img').html5Uploader('insertItemNew',{src:url,id:ids[index]});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("</script>\n");
                                              }
                                        }
                                        else {
                                        <input id='pagepath' name="pagepath"  maxlength="100" value="" type="text" class="form-control column" >}}
                                </div>
                            </div>
                          <div class="form-group form-group-sm">
                        <label class="col-sm-2 control-label">@TranslateService.GetTranslate("","PushMessage_ms_messagepointconfig_templeteId","模板ID")</label>
                        <div class="col-sm-5">@{
                                        base_selectresource_data dataselecttempleteId = dataHelper.GetDataUrlAll("PushMessage", "ms_messagepointconfig", "templeteId");
                                        if(!dataselecttempleteId.sr.IsNullOrEmpty()&&!dataselecttempleteId.sr.Id.IsNullOrEmpty()){
                                            if( dataselecttempleteId.bs.selecttype=="1")
                                            {
                                                <select id='templeteId' name="templeteId" value="" class="form-control column selectpicker" data-live-search="true"  >
                                                    @foreach (DataRow rows in dataselecttempleteId.data.Rows)
                                                    {
                                                             <option value="@rows[0]" >@rows[1]</option>
                                                    }
                                                </select>
                                            
                                            }
                                            if( dataselecttempleteId.bs.selecttype=="3")
                                            {
                                                <select id='templeteId' name="templeteId" value="" class="form-control column selectpicker" data-live-search="true" multiple >
                                                    @foreach (DataRow rows in dataselecttempleteId.data.Rows)
                                                    {
                                                             <option value="@rows[0]" >@rows[1]</option>
                                                    }
                                                </select>
                                            }
                                             if( dataselecttempleteId.bs.selecttype=="2")
                                             {
                                                 string typename = @dataselecttempleteId.sr.tablename.Split('.')[@dataselecttempleteId.sr.tablename.Split('.').Length - 1];
                                                 string areaname = @dataselecttempleteId.sr.tablename.Split('.')[@dataselecttempleteId.sr.tablename.Split('.').Length - 3];
                                                 <input id='templeteId__Name' name='templeteId__Name' value='' onclick='openFormSelect("/@areaname/@typename","@dataselecttempleteId.sr.filedcode,@dataselecttempleteId.sr.filedvalue",this); ' type='text' class='form-control column'  readonly='readonly'/>
                                                 <input id='templeteId' name='templeteId' value=''  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                              }
                                             if( dataselecttempleteId.bs.selecttype=="4")
                                             {
                                                 <div id='templeteIdImg' style='width:100%; height:200px; overflow: auto'></div>
                                                 <input id='templeteId__Name' name='templeteId__Name' value='' type='text' style='display:none'  class='form-control column'  readonly='readonly'/>
                                                 <input id='templeteId' name='templeteId' value=''  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                                  @Html.Raw("<script>\n");
                                                  @Html.Raw("$(function(){\n");
                                                  @Html.Raw("$('#templeteId__Img').html5Uploader({\n");
                                                  @Html.Raw("asyncUpload: true,\n");
                                                  @Html.Raw("uploadUrl: '/Base_SysManage/Common/UploadFile',\n");
                                                  @Html.Raw($"uploadLimit: {dataselecttempleteId.getPropValue("filenum")},  //上传数量限制，0为不限\n");
                                                  @Html.Raw($"sizeLimit:{dataselecttempleteId.getPropValue("filesize")},    //大小限制，M\n");
                                                  @Html.Raw($"type: '{dataselecttempleteId.getPropValue("filetype")}' //file即可上传文件也可上传图片\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("$('#templeteId__Name').on(' input propertychange',function(){\n");
                                                  @Html.Raw("var urls = $(this).val().split(',');\n");
                                                  @Html.Raw("var ids = $('#templeteId').val().split(',');\n");
                                                  @Html.Raw("$.each(urls, function(index, url){\n");
                                                  @Html.Raw("if(url!='')\n");
                                                  @Html.Raw("$('#templeteId__Img').html5Uploader('insertItemNew',{src:url,id:ids[index]});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("</script>\n");
                                              }
                                        }
                                        else {
                                        <input id='templeteId' name="templeteId"  maxlength="100" value="" type="text" class="form-control column" >}}
                                </div>
                            </div>
                          <div class="form-group form-group-sm">
                        <label class="col-sm-2 control-label">@TranslateService.GetTranslate("","PushMessage_ms_messagepointconfig_templeteset","模板映射规则")</label>
                        <div class="col-sm-5">@{
                                        base_selectresource_data dataselecttempleteset = dataHelper.GetDataUrlAll("PushMessage", "ms_messagepointconfig", "templeteset");
                                        if(!dataselecttempleteset.sr.IsNullOrEmpty()&&!dataselecttempleteset.sr.Id.IsNullOrEmpty()){
                                            if( dataselecttempleteset.bs.selecttype=="1")
                                            {
                                                <select id='templeteset' name="templeteset" value="" class="form-control column selectpicker" data-live-search="true"  >
                                                    @foreach (DataRow rows in dataselecttempleteset.data.Rows)
                                                    {
                                                             <option value="@rows[0]" >@rows[1]</option>
                                                    }
                                                </select>
                                            
                                            }
                                            if( dataselecttempleteset.bs.selecttype=="3")
                                            {
                                                <select id='templeteset' name="templeteset" value="" class="form-control column selectpicker" data-live-search="true" multiple >
                                                    @foreach (DataRow rows in dataselecttempleteset.data.Rows)
                                                    {
                                                             <option value="@rows[0]" >@rows[1]</option>
                                                    }
                                                </select>
                                            }
                                             if( dataselecttempleteset.bs.selecttype=="2")
                                             {
                                                 string typename = @dataselecttempleteset.sr.tablename.Split('.')[@dataselecttempleteset.sr.tablename.Split('.').Length - 1];
                                                 string areaname = @dataselecttempleteset.sr.tablename.Split('.')[@dataselecttempleteset.sr.tablename.Split('.').Length - 3];
                                                 <input id='templeteset__Name' name='templeteset__Name' value='' onclick='openFormSelect("/@areaname/@typename","@dataselecttempleteset.sr.filedcode,@dataselecttempleteset.sr.filedvalue",this); ' type='text' class='form-control column'  readonly='readonly'/>
                                                 <input id='templeteset' name='templeteset' value=''  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                              }
                                             if( dataselecttempleteset.bs.selecttype=="4")
                                             {
                                                 <div id='templetesetImg' style='width:100%; height:200px; overflow: auto'></div>
                                                 <input id='templeteset__Name' name='templeteset__Name' value='' type='text' style='display:none'  class='form-control column'  readonly='readonly'/>
                                                 <input id='templeteset' name='templeteset' value=''  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                                  @Html.Raw("<script>\n");
                                                  @Html.Raw("$(function(){\n");
                                                  @Html.Raw("$('#templeteset__Img').html5Uploader({\n");
                                                  @Html.Raw("asyncUpload: true,\n");
                                                  @Html.Raw("uploadUrl: '/Base_SysManage/Common/UploadFile',\n");
                                                  @Html.Raw($"uploadLimit: {dataselecttempleteset.getPropValue("filenum")},  //上传数量限制，0为不限\n");
                                                  @Html.Raw($"sizeLimit:{dataselecttempleteset.getPropValue("filesize")},    //大小限制，M\n");
                                                  @Html.Raw($"type: '{dataselecttempleteset.getPropValue("filetype")}' //file即可上传文件也可上传图片\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("$('#templeteset__Name').on(' input propertychange',function(){\n");
                                                  @Html.Raw("var urls = $(this).val().split(',');\n");
                                                  @Html.Raw("var ids = $('#templeteset').val().split(',');\n");
                                                  @Html.Raw("$.each(urls, function(index, url){\n");
                                                  @Html.Raw("if(url!='')\n");
                                                  @Html.Raw("$('#templeteset__Img').html5Uploader('insertItemNew',{src:url,id:ids[index]});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("</script>\n");
                                              }
                                        }
                                        else {
                                        <input id='templeteset' name="templeteset"  maxlength="1000" value="" type="text" class="form-control column" >}}
                                </div>
                            </div>
                          <div class="form-group form-group-sm">
                        <label class="col-sm-2 control-label">@TranslateService.GetTranslate("","PushMessage_ms_messagepointconfig_RoleId","推送人角色ID")</label>
                        <div class="col-sm-5">@{
                                        base_selectresource_data dataselectRoleId = dataHelper.GetDataUrlAll("PushMessage", "ms_messagepointconfig", "RoleId");
                                        if(!dataselectRoleId.sr.IsNullOrEmpty()&&!dataselectRoleId.sr.Id.IsNullOrEmpty()){
                                            if( dataselectRoleId.bs.selecttype=="1")
                                            {
                                                <select id='RoleId' name="RoleId" value="" class="form-control column selectpicker" data-live-search="true"  >
                                                    @foreach (DataRow rows in dataselectRoleId.data.Rows)
                                                    {
                                                             <option value="@rows[0]" >@rows[1]</option>
                                                    }
                                                </select>
                                            
                                            }
                                            if( dataselectRoleId.bs.selecttype=="3")
                                            {
                                                <select id='RoleId' name="RoleId" value="" class="form-control column selectpicker" data-live-search="true" multiple >
                                                    @foreach (DataRow rows in dataselectRoleId.data.Rows)
                                                    {
                                                             <option value="@rows[0]" >@rows[1]</option>
                                                    }
                                                </select>
                                            }
                                             if( dataselectRoleId.bs.selecttype=="2")
                                             {
                                                 string typename = @dataselectRoleId.sr.tablename.Split('.')[@dataselectRoleId.sr.tablename.Split('.').Length - 1];
                                                 string areaname = @dataselectRoleId.sr.tablename.Split('.')[@dataselectRoleId.sr.tablename.Split('.').Length - 3];
                                                 <input id='RoleId__Name' name='RoleId__Name' value='' onclick='openFormSelect("/@areaname/@typename","@dataselectRoleId.sr.filedcode,@dataselectRoleId.sr.filedvalue",this); ' type='text' class='form-control column'  readonly='readonly'/>
                                                 <input id='RoleId' name='RoleId' value=''  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                              }
                                             if( dataselectRoleId.bs.selecttype=="4")
                                             {
                                                 <div id='RoleIdImg' style='width:100%; height:200px; overflow: auto'></div>
                                                 <input id='RoleId__Name' name='RoleId__Name' value='' type='text' style='display:none'  class='form-control column'  readonly='readonly'/>
                                                 <input id='RoleId' name='RoleId' value=''  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                                  @Html.Raw("<script>\n");
                                                  @Html.Raw("$(function(){\n");
                                                  @Html.Raw("$('#RoleId__Img').html5Uploader({\n");
                                                  @Html.Raw("asyncUpload: true,\n");
                                                  @Html.Raw("uploadUrl: '/Base_SysManage/Common/UploadFile',\n");
                                                  @Html.Raw($"uploadLimit: {dataselectRoleId.getPropValue("filenum")},  //上传数量限制，0为不限\n");
                                                  @Html.Raw($"sizeLimit:{dataselectRoleId.getPropValue("filesize")},    //大小限制，M\n");
                                                  @Html.Raw($"type: '{dataselectRoleId.getPropValue("filetype")}' //file即可上传文件也可上传图片\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("$('#RoleId__Name').on(' input propertychange',function(){\n");
                                                  @Html.Raw("var urls = $(this).val().split(',');\n");
                                                  @Html.Raw("var ids = $('#RoleId').val().split(',');\n");
                                                  @Html.Raw("$.each(urls, function(index, url){\n");
                                                  @Html.Raw("if(url!='')\n");
                                                  @Html.Raw("$('#RoleId__Img').html5Uploader('insertItemNew',{src:url,id:ids[index]});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("</script>\n");
                                              }
                                        }
                                        else {
                                        <input id='RoleId' name="RoleId"  maxlength="1000" value="" type="text" class="form-control column" >}}
                                </div>
                            </div>
                          <div class="form-group form-group-sm">
                        <label class="col-sm-2 control-label">@TranslateService.GetTranslate("","PushMessage_ms_messagepointconfig_UserId","覆盖推送人ID")</label>
                        <div class="col-sm-5">@{
                                        base_selectresource_data dataselectUserId = dataHelper.GetDataUrlAll("PushMessage", "ms_messagepointconfig", "UserId");
                                        if(!dataselectUserId.sr.IsNullOrEmpty()&&!dataselectUserId.sr.Id.IsNullOrEmpty()){
                                            if( dataselectUserId.bs.selecttype=="1")
                                            {
                                                <select id='UserId' name="UserId" value="" class="form-control column selectpicker" data-live-search="true"  >
                                                    @foreach (DataRow rows in dataselectUserId.data.Rows)
                                                    {
                                                             <option value="@rows[0]" >@rows[1]</option>
                                                    }
                                                </select>
                                            
                                            }
                                            if( dataselectUserId.bs.selecttype=="3")
                                            {
                                                <select id='UserId' name="UserId" value="" class="form-control column selectpicker" data-live-search="true" multiple >
                                                    @foreach (DataRow rows in dataselectUserId.data.Rows)
                                                    {
                                                             <option value="@rows[0]" >@rows[1]</option>
                                                    }
                                                </select>
                                            }
                                             if( dataselectUserId.bs.selecttype=="2")
                                             {
                                                 string typename = @dataselectUserId.sr.tablename.Split('.')[@dataselectUserId.sr.tablename.Split('.').Length - 1];
                                                 string areaname = @dataselectUserId.sr.tablename.Split('.')[@dataselectUserId.sr.tablename.Split('.').Length - 3];
                                                 <input id='UserId__Name' name='UserId__Name' value='' onclick='openFormSelect("/@areaname/@typename","@dataselectUserId.sr.filedcode,@dataselectUserId.sr.filedvalue",this); ' type='text' class='form-control column'  readonly='readonly'/>
                                                 <input id='UserId' name='UserId' value=''  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                              }
                                             if( dataselectUserId.bs.selecttype=="4")
                                             {
                                                 <div id='UserIdImg' style='width:100%; height:200px; overflow: auto'></div>
                                                 <input id='UserId__Name' name='UserId__Name' value='' type='text' style='display:none'  class='form-control column'  readonly='readonly'/>
                                                 <input id='UserId' name='UserId' value=''  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                                  @Html.Raw("<script>\n");
                                                  @Html.Raw("$(function(){\n");
                                                  @Html.Raw("$('#UserId__Img').html5Uploader({\n");
                                                  @Html.Raw("asyncUpload: true,\n");
                                                  @Html.Raw("uploadUrl: '/Base_SysManage/Common/UploadFile',\n");
                                                  @Html.Raw($"uploadLimit: {dataselectUserId.getPropValue("filenum")},  //上传数量限制，0为不限\n");
                                                  @Html.Raw($"sizeLimit:{dataselectUserId.getPropValue("filesize")},    //大小限制，M\n");
                                                  @Html.Raw($"type: '{dataselectUserId.getPropValue("filetype")}' //file即可上传文件也可上传图片\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("$('#UserId__Name').on(' input propertychange',function(){\n");
                                                  @Html.Raw("var urls = $(this).val().split(',');\n");
                                                  @Html.Raw("var ids = $('#UserId').val().split(',');\n");
                                                  @Html.Raw("$.each(urls, function(index, url){\n");
                                                  @Html.Raw("if(url!='')\n");
                                                  @Html.Raw("$('#UserId__Img').html5Uploader('insertItemNew',{src:url,id:ids[index]});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("</script>\n");
                                              }
                                        }
                                        else {
                                        <input id='UserId' name="UserId"  maxlength="1000" value="" type="text" class="form-control column" >}}
                                </div>
                            </div>
                          <div class="form-group form-group-sm">
                        <label class="col-sm-2 control-label">@TranslateService.GetTranslate("","PushMessage_ms_messagepointconfig_ExUserId","额外推送人Id")</label>
                        <div class="col-sm-5">@{
                                        base_selectresource_data dataselectExUserId = dataHelper.GetDataUrlAll("PushMessage", "ms_messagepointconfig", "ExUserId");
                                        if(!dataselectExUserId.sr.IsNullOrEmpty()&&!dataselectExUserId.sr.Id.IsNullOrEmpty()){
                                            if( dataselectExUserId.bs.selecttype=="1")
                                            {
                                                <select id='ExUserId' name="ExUserId" value="" class="form-control column selectpicker" data-live-search="true"  >
                                                    @foreach (DataRow rows in dataselectExUserId.data.Rows)
                                                    {
                                                             <option value="@rows[0]" >@rows[1]</option>
                                                    }
                                                </select>
                                            
                                            }
                                            if( dataselectExUserId.bs.selecttype=="3")
                                            {
                                                <select id='ExUserId' name="ExUserId" value="" class="form-control column selectpicker" data-live-search="true" multiple >
                                                    @foreach (DataRow rows in dataselectExUserId.data.Rows)
                                                    {
                                                             <option value="@rows[0]" >@rows[1]</option>
                                                    }
                                                </select>
                                            }
                                             if( dataselectExUserId.bs.selecttype=="2")
                                             {
                                                 string typename = @dataselectExUserId.sr.tablename.Split('.')[@dataselectExUserId.sr.tablename.Split('.').Length - 1];
                                                 string areaname = @dataselectExUserId.sr.tablename.Split('.')[@dataselectExUserId.sr.tablename.Split('.').Length - 3];
                                                 <input id='ExUserId__Name' name='ExUserId__Name' value='' onclick='openFormSelect("/@areaname/@typename","@dataselectExUserId.sr.filedcode,@dataselectExUserId.sr.filedvalue",this); ' type='text' class='form-control column'  readonly='readonly'/>
                                                 <input id='ExUserId' name='ExUserId' value=''  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                              }
                                             if( dataselectExUserId.bs.selecttype=="4")
                                             {
                                                 <div id='ExUserIdImg' style='width:100%; height:200px; overflow: auto'></div>
                                                 <input id='ExUserId__Name' name='ExUserId__Name' value='' type='text' style='display:none'  class='form-control column'  readonly='readonly'/>
                                                 <input id='ExUserId' name='ExUserId' value=''  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                                  @Html.Raw("<script>\n");
                                                  @Html.Raw("$(function(){\n");
                                                  @Html.Raw("$('#ExUserId__Img').html5Uploader({\n");
                                                  @Html.Raw("asyncUpload: true,\n");
                                                  @Html.Raw("uploadUrl: '/Base_SysManage/Common/UploadFile',\n");
                                                  @Html.Raw($"uploadLimit: {dataselectExUserId.getPropValue("filenum")},  //上传数量限制，0为不限\n");
                                                  @Html.Raw($"sizeLimit:{dataselectExUserId.getPropValue("filesize")},    //大小限制，M\n");
                                                  @Html.Raw($"type: '{dataselectExUserId.getPropValue("filetype")}' //file即可上传文件也可上传图片\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("$('#ExUserId__Name').on(' input propertychange',function(){\n");
                                                  @Html.Raw("var urls = $(this).val().split(',');\n");
                                                  @Html.Raw("var ids = $('#ExUserId').val().split(',');\n");
                                                  @Html.Raw("$.each(urls, function(index, url){\n");
                                                  @Html.Raw("if(url!='')\n");
                                                  @Html.Raw("$('#ExUserId__Img').html5Uploader('insertItemNew',{src:url,id:ids[index]});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("</script>\n");
                                              }
                                        }
                                        else {
                                        <input id='ExUserId' name="ExUserId"  maxlength="1000" value="" type="text" class="form-control column" >}}
                                </div>
                            </div>
                        <div class="form-group form-group-sm">
                            <label class="col-sm-2 control-label">@TranslateService.GetTranslate("","PushMessage_ms_messagepointconfig_FsNo","排序")</label>
                            <div class="col-sm-5">
                                    <input id="FsNo" name="FsNo"  maxlength="1000" placeholder="0" value="" type="number"  class="form-control column" >
                                <div class="help-block with-errors"></div>
                            </div>
                        </div>
                          <div class="form-group form-group-sm">
                        <label class="col-sm-2 control-label">@TranslateService.GetTranslate("","PushMessage_ms_messagepointconfig_Remark","描述")</label>
                        <div class="col-sm-5">@{
                                        base_selectresource_data dataselectRemark = dataHelper.GetDataUrlAll("PushMessage", "ms_messagepointconfig", "Remark");
                                        if(!dataselectRemark.sr.IsNullOrEmpty()&&!dataselectRemark.sr.Id.IsNullOrEmpty()){
                                            if( dataselectRemark.bs.selecttype=="1")
                                            {
                                                <select id='Remark' name="Remark" value="" class="form-control column selectpicker" data-live-search="true"  >
                                                    @foreach (DataRow rows in dataselectRemark.data.Rows)
                                                    {
                                                             <option value="@rows[0]" >@rows[1]</option>
                                                    }
                                                </select>
                                            
                                            }
                                            if( dataselectRemark.bs.selecttype=="3")
                                            {
                                                <select id='Remark' name="Remark" value="" class="form-control column selectpicker" data-live-search="true" multiple >
                                                    @foreach (DataRow rows in dataselectRemark.data.Rows)
                                                    {
                                                             <option value="@rows[0]" >@rows[1]</option>
                                                    }
                                                </select>
                                            }
                                             if( dataselectRemark.bs.selecttype=="2")
                                             {
                                                 string typename = @dataselectRemark.sr.tablename.Split('.')[@dataselectRemark.sr.tablename.Split('.').Length - 1];
                                                 string areaname = @dataselectRemark.sr.tablename.Split('.')[@dataselectRemark.sr.tablename.Split('.').Length - 3];
                                                 <input id='Remark__Name' name='Remark__Name' value='' onclick='openFormSelect("/@areaname/@typename","@dataselectRemark.sr.filedcode,@dataselectRemark.sr.filedvalue",this); ' type='text' class='form-control column'  readonly='readonly'/>
                                                 <input id='Remark' name='Remark' value=''  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                              }
                                             if( dataselectRemark.bs.selecttype=="4")
                                             {
                                                 <div id='RemarkImg' style='width:100%; height:200px; overflow: auto'></div>
                                                 <input id='Remark__Name' name='Remark__Name' value='' type='text' style='display:none'  class='form-control column'  readonly='readonly'/>
                                                 <input id='Remark' name='Remark' value=''  type='text' style='display:none' class='form-control column'  readonly='readonly'/>
                                                  @Html.Raw("<script>\n");
                                                  @Html.Raw("$(function(){\n");
                                                  @Html.Raw("$('#Remark__Img').html5Uploader({\n");
                                                  @Html.Raw("asyncUpload: true,\n");
                                                  @Html.Raw("uploadUrl: '/Base_SysManage/Common/UploadFile',\n");
                                                  @Html.Raw($"uploadLimit: {dataselectRemark.getPropValue("filenum")},  //上传数量限制，0为不限\n");
                                                  @Html.Raw($"sizeLimit:{dataselectRemark.getPropValue("filesize")},    //大小限制，M\n");
                                                  @Html.Raw($"type: '{dataselectRemark.getPropValue("filetype")}' //file即可上传文件也可上传图片\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("$('#Remark__Name').on(' input propertychange',function(){\n");
                                                  @Html.Raw("var urls = $(this).val().split(',');\n");
                                                  @Html.Raw("var ids = $('#Remark').val().split(',');\n");
                                                  @Html.Raw("$.each(urls, function(index, url){\n");
                                                  @Html.Raw("if(url!='')\n");
                                                  @Html.Raw("$('#Remark__Img').html5Uploader('insertItemNew',{src:url,id:ids[index]});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("});\n");
                                                  @Html.Raw("</script>\n");
                                              }
                                        }
                                        else {
                                        <input id='Remark' name="Remark"  maxlength="200" value="" type="text" class="form-control column" >}}
                                </div>
                            </div>
         @{
            List<base_extendedfield> exs = dataHelper.GetExFileds("PushMessage", "ms_messagepointconfig");
            foreach (var ex in exs)
            {
                <div class='form-group form-group-sm'>
                <label class='col-sm-2 control-label'>@TranslateService.GetTranslate("", $@"PushMessage_ms_messagepointconfig_{ex.exfiled}", $@"{ex.filedname}")</label>
                    <div class='col-sm-5'>
                            @{base_selectresource_data dataselect = dataHelper.GetDataUrlAll("PushMessage", "ms_messagepointconfig", $@"{ex.exfiled}");
                                if (!dataselect.sr.IsNullOrEmpty() && !dataselect.sr.Id.IsNullOrEmpty())
                                {
                                    if (dataselect.bs.selecttype == "1")
                                    {
                                        <select id='@ex.exfiled' name='@ex.exfiled' value='' class='form-control column selectpicker' data-live-search='true'>
                                            @foreach (DataRow rows in dataselect.data.Rows)
                                            {
                                                 <option value='@rows[0]'>@rows[1]</option>
                                            }
                                        </select>

                                    }
                                    @if(dataselect.bs.selecttype == "3")
                                    {
                                        <select id='@ex.exfiled' name='@ex.exfiled' value='' class='form-control column selectpicker' data-live-search='true' multiple>
                                            @foreach (DataRow rows in dataselect.data.Rows)
                                            {
                                                <option value='@rows[0]'>@rows[1]</option>
                                            }
                                        </select>
                                    }
                                    if (dataselect.bs.selecttype == "2")
                                    {
                                        string typename = dataselect.sr.tablename.Split('.')[dataselect.sr.tablename.Split('.').Length - 1];
                                        string areaname = dataselect.sr.tablename.Split('.')[dataselect.sr.tablename.Split('.').Length - 3];
                                        <input readonly='readonly' id='@ex.exfiled;__Name' name='{@ex.exfiled}__Name' value='' onclick='openFormSelect('/@areaname/@typename','@dataselect.sr.filedcode,@dataselect.sr.filedvalue',this); ' type='text' class='form-control column' readonly='readonly'>
                                        <input readonly='readonly' id='@ex.exfiled' name='{@ex.exfiled}' value='' type='text' style='display:none' class='form-control column' readonly='readonly'>
                                    }
                                    if (dataselect.bs.selecttype == "4")
                                    {
                                        <div id='@ex.exfiled;__Img' style='width:100%; height:200px; overflow: auto'></div>
                                        <input id='@ex.exfiled;__Name' name='@ex.exfiled;__Name' value='' type='text' style='display:none' class='form-control column' readonly='readonly' />
                                        <input id='@ex.exfiled' name='@ex.exfiled' value='' type='text' style='display:none' class='form-control column' readonly='readonly' />
                                        @Html.Raw($@"<script>\n");
                                        @Html.Raw($@"$(function(){{\n");
                                        @Html.Raw($@"$('#{ex.exfiled}__Img').html5Uploader({{\n");
                                        @Html.Raw($@"asyncUpload: true,\n");
                                        @Html.Raw($@"uploadUrl: '/Base_SysManage/Common/UploadFile',\n");
                                        @Html.Raw($@"uploadLimit: 0,  //上传数量限制，0为不限\n");
                                        @Html.Raw($@"sizeLimit: 5,    //大小限制，M\n");
                                        @Html.Raw($@"type: 'file' //file即可上传文件也可上传图片\n");
                                        @Html.Raw($@"}});\n");
                                        @Html.Raw($@"$('#{ex.exfiled}__Name').trigger('propertychange');}});\n");
                                        @Html.Raw($@"$('#{ex.exfiled}__Name').on(' input propertychange',function(){{\n");
                                        @Html.Raw($@"var urls = $(this).val().split(',');\n");
                                        @Html.Raw($@"var ids = $('#{ex.exfiled}').val().split(',');\n");
                                        @Html.Raw($@"$.each(urls, function(index, url){{\n");
                                        @Html.Raw($@"if(url!='')\n");
                                        @Html.Raw($@"$('#{ex.exfiled}__Img').html5Uploader('insertItemNew',{{src:url,id:ids[index]}});\n");
                                        @Html.Raw($@"}});\n");
                                        @Html.Raw($@"}});\n");
                                        @Html.Raw($@"</script>\n");
                                    }
                                }
                                else
                                {
                                    <input id='@ex.exfiled' name='@ex.exfiled' maxlength='100' value='' type='text' class='form-control column'>
                                }
                            }
                    </div>
                </div>
             }
        }
        <div class="form-group">
            <button id="submit" type="submit" class="hidden">@TranslateService.GetTranslate("","System_Submit","提交")</button>
        </div>
    </form>
</div>
<script>
     var guid ='@guid';
     var key ='@key';
     var value ='@value';
     var data = JSON.parse(sessionStorage.getItem("ms_messagepointconfig"+guid));
     var rownum = @rownum;
     if (rownum >= 0)
     {
                for (i in data.rows[rownum])
                {
                    if ($("[name='" + i + "']").is ('.selectpicker')) {
                    $("[name='" + i + "']").selectpicker("val", data.rows[rownum][i].split(",")).trigger("propertychange");
                } else
                {
                $("[name='" + i + "']").val(data.rows[rownum][i]).trigger("propertychange");
                }
            }
        }

    $(function () {
        initEvent();
        $('#'+key).attr("required",false);
        $('#'+key).attr("readonly","readonly");
    });

    //事件绑定
    function initEvent() {
        //表单校验
        $('#form').validator().on('submit', function (e) {
            //校验成功
            if (!e.isDefaultPrevented()) {
                e.preventDefault();

                var values = $('#form').getValues();
                    var theEntity=values;
                    for (var item in theEntity){
                            if(theEntity[item]!=null)
                            theEntity[item] = theEntity[item].toString();
                    }
                    loading();
                    if (rownum >= 0) {
                        theEntity['ck'] = true;
                        if (data == null) {
                            data = {};
                            data['rows'] = new Array();
                        }
                        for (var item in theEntity){
                            data.rows[rownum][item] = theEntity[item];
                        }
                    }
                    else {
                        theEntity['ck'] = true;
                        if (data == null) {
                            data = {};
                            data['rows'] = new Array();
                        }
                        data.rows.push(theEntity);
                    }
                    sessionStorage.setItem("ms_messagepointconfig"+guid, JSON.stringify(data));
                    dialogClose();
            }
        })
    }

    //提交表单
    function submitForm() {
        $('#submit').trigger('click');
    }
     $(function () {
        $('#WorkerContractImg').html5Uploader({
            //imgs: theEntity[aImgId],
            asyncUpload: true,
            uploadUrl: '/Base_SysManage/Common/UploadFile',
            uploadLimit: 0,  //上传数量限制，0为不限
            sizeLimit: 5,    //大小限制，M
            type:'file' //file即可上传文件也可上传图片
        });
    });

    
    //手写文字识别
    function OCRForm() {
        //获取上传后的url
        var url = $('#WorkerContractImg').html5Uploader('getUploadFiles');
        //console.log(url);   
        // 返回 web 主机的域名，如：http://127.0.0.1:8080/testdemo/test.html?id=1&name=test
        var href = window.location.href; 
        // 返回当前页面的路径和文件名，如：/testdemo/test.html
        var pathname = window.location.pathname;
        pathname = href.replace(pathname, "");
        // 获取参数，如：?id=1&name=test
        var search = window.location.search;
        pathname = pathname.replace(search, "") + " / ";


        url = (String(url)).replace(pathname, "");
            url = url.replace(/\//g, "\\");


            loading();
        $.postJSON('/Visit/visit_type_authorize/OCRData', { FileName: (url) }, function (resJson) {
                //loading(false);
                if (resJson.Success) {
                   $table.bootstrapTable('refresh');
                    dialogSuccess('表单识别成功!');
                }
                else {
                    dialogError(resJson.Msg);
                }
            });       
    }
    //语音识别输入
    function speech() {
    alert('功能完善中');
    }
 
    
    function openFormSelect(modelurl,returnkey,obj) {
        dialogOpen({
            id: 'form1',
            title: '@TranslateService.GetTranslate("","System_Select","选择")',
            btn: ['@TranslateService.GetTranslate("","System_Confirm","确定")', '@TranslateService.GetTranslate("","System_Cancel","取消")'],
            height: '80%',
            url: modelurl + '/GetIndex?returnkey=' + returnkey,
            yes: function(window, index) {
                 $(obj).val(window.chekcName);
                 $(obj).next().val(window.chekcCode).trigger("propertychange");
                 dialogClose("form1");
            }
        });
    }
</script>
